package cn.snow.boot.service;

import cn.snow.boot.annotation.TargetDataSource;
import cn.snow.boot.datasource.DbName;
import cn.snow.boot.entity.Config;
import cn.snow.boot.entity.User;
import cn.snow.boot.mapper.ConfigMapper;
import cn.snow.boot.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuwanxiang
 * @version 2019/05/28
 */
@Service
public class CommonService {

    @Autowired
    private ConfigMapper configMapper;

    @Autowired
    private UserMapper userMapper;

    @TargetDataSource(DbName.CONFIG)
    public List<Config> getConfigList(){
        return configMapper.selectAll();
    }

    public List<User> getUserList(){
        return userMapper.selectAll();
    }

}
